package day05;

/**
 * 测试一下面向对象多态特性
 */
public class Test03 {
    public static void main(String[] args) {
        Person p1 = new Student();
        p1.name = "zhangsan";
        p1.eat();
        p1.sleep();
        ((Student)p1).study();
        ((Student)p1).exam();





        //以上代码证明有继承关系
        /*
          继承关系成立要符合以下条件：
          等号两边：从左到右是 has a 关系   person has a student
                   从右到左是：is a 关系  student is a person
         */
    }
}

